﻿Imports tiendaRegalos

Public Class BuscarProducto

    Private Sub BuscarProducto_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim criterio As String = Me.txtBuscar.Text
        'MsgBox(criterio)

        Dim negocio As New ProductoNegocio
        Dim producto As Collection = negocio.buscarPorNombre(criterio)
        Me.dgbProductos.DataSource = producto
        Me.dgbProductos.EditMode = False

        Me.dgbProductos.Columns(0).HeaderText = "IdProducto"
        Me.dgbProductos.Columns(1).HeaderText = "Nombre"
        Me.dgbProductos.Columns(2).HeaderText = "Stock"
        Me.dgbProductos.Columns(3).HeaderText = "Precio"
        Me.dgbProductos.Columns(4).HeaderText = "Disponibilidad"
    End Sub
End Class